package pers.cj.pdos.service;

import pers.cj.pdos.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.vo.BorrowOutVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 借出单生成后需要仓库管理关出库操作；后面如果是转销售后，状态改成已归还;如果是还的操作，则仓库管理员还需要进行入库操作 服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface IBorrowOutService extends IService<BorrowOut> {

    List<BorrowOutVo> listVo(String companyId,
                             Integer page,
                             Integer limit,
                             Boolean close,
                             String search,
                             String no,
                             String goodsName,
                             String remark,
                             String custom,
                             Date makeTime1,
                             Date makeTime2,
                             String storeId,
                             String userStoreId,
                             String userId,
                             Date date1,
                             Date date2,
                             String houseId,
                             String makeUserId,
                             Integer outStatus);

    long count(String companyId,
               Boolean close,
               String search,
               String no,
               String goodsName,
               String remark,
               String custom,
               Date makeTime1,
               Date makeTime2,
               String storeId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               String houseId,
               String makeUserId,
               Integer outStatus);

    boolean checkNo(String no, String companyId);

    boolean checkClose(BorrowOut borrowOut);

    void insert(BusinessSet businessSet, BorrowOut borrowOut, List<BorrowOutGoods> borrowOutGoodsList, List<GoodsSn> goodsSnList, List<GoodsSnLog> goodsSnLogList);

    void close(BorrowOut borrowOut, BusinessSet businessSet);

    BorrowOutVo getVoById(String id);

    List<BorrowOutVo> listVoByIds(List<String> ids);
}
